Skip to content

feat: publish GitHub PRs and GitLab MRs with optional AI drafts - #2901

Draft
DJ-Huang wants to merge 10 commits into
sourcegit-org:developfrom
DJ-Huang:codex/sourcegit-pr-mr-publishing
Draft

DJ-Huang wants to merge 10 commits into
sourcegit-org:developfrom
DJ-Huang:codex/sourcegit-pr-mr-publishing

Conversation

@DJ-Huang

@DJ-Huang DJ-Huang commented Nov 25, 2026 •

Copy link
Copy Markdown

Review order

This draft depends on #2900 for the external CLI profile and runner used to generate optional drafts. Both PRs target upstream develop. Review publishing changes only

Summary

  • Right-click a local branch and choose AI → Create PR/MR…. Review the source and target repositories and branches. Enter a title and Markdown description, or generate an editable draft from the branch's Git history and diff.
  • Add a GitHub or GitLab token in Preferences → PR/MR credentials. SourceGit stores the token in the system keychain and matches the connection to the target remote's host. Git operations use the repository's existing authentication. Hosted and self-managed instances use the same workflow.
  • Push if needed and publish rechecks the reviewed refs, updates the source remote when needed, and looks for a matching request before creating one. A rejected push stops publication. After an uncertain create result, retrying checks for an existing request first.

Set up credentials, choose remotes, and troubleshoot publishing

Screenshots

English SourceGit UI, captured with a temporary repository, sample GitHub remotes, and an example CLI. The token field is empty.

Review the destination and edit the draft

The publish dialog shows separate fork and upstream remotes, an editable draft, and the matched GitHub connection

Configure a provider credential

The access token dialog shows the provider, HTTPS server address, and empty token field

Verification

  • Built on Windows with .NET 10 and passed dotnet format --verify-no-changes.
  • Two local bare remotes and a controlled publisher covered separate source and target remotes, rejected pushes, and recovery after an uncertain result.
  • Provider checks used a loopback GitHub API for cross-fork publication and a self-managed GitLab instance for authenticated read-only lookups. Live GitHub and GitLab creation and macOS/Linux UI checks remain pending.

Related to #980 and #2802.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant